<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<head>
    <meta charset="utf-8">
    <meta name="keywords" content=", hexo-theme-matery">
    <meta name="description" content="有事多研究 没事多琢磨">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>Five-great的博客</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/css/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery-2.2.0.min.js"></script>
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css">
<link rel="stylesheet" href="/css/prism-line-numbers.css" type="text/css"></head>  
</head>

<body>

<header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="container">
            <div class="nav-wrapper">
                <div class="brand-logo">
                    <a href="/" class="waves-effect waves-light">
                        
                        <img src="/medias/logo.png" class="logo-img hide-on-small-only">
                        
                        <span class="logo-span">Five-great的博客</span>
                    </a>
                </div>

                <a href="#" data-activates="mobile-nav" class="button-collapse"><i class="fa fa-navicon"></i></a>
<ul class="right">
    
    
    <li class="hide-on-med-and-down">
        <a href="/" class="waves-effect waves-light">首页</a>
    </li>
    
    
    
    <li class="hide-on-med-and-down">
        <a href="/tags" class="waves-effect waves-light">标签</a>
    </li>
    
    
    
    <li class="hide-on-med-and-down">
        <a href="/archives" class="waves-effect waves-light">归档</a>
    </li>
    
    
    
    <li class="hide-on-med-and-down">
        <a href="/atom.xml" class="waves-effect waves-light">RSS订阅</a>
    </li>
    
    
    
    <li class="hide-on-med-and-down">
        <a href="/about" class="waves-effect waves-light">关于</a>
    </li>
    
    
    <li>
        <a id="toggleSearch" class="waves-effect waves-light">
            <i id="searchIcon" class="mdi-action-search"></i>
        </a>
    </li>

</ul>

<div class="side-nav" id="mobile-nav">
    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">Five-great的博客</div>
        <div class="logo-desc">
            
            有事多研究 没事多琢磨
            
        </div>
    </div>
    <ul class="menu-list">
        
        <li>
            <a href="/" class="waves-effect waves-light">
                <!--<i class="fa fa-link fa-lg fa-fw"></i>首页-->
				<i class="fa fa-chevron-right fa-lg"></i>首页
            </a>
        </li>
        
        <li>
            <a href="/tags" class="waves-effect waves-light">
                <!--<i class="fa fa-link fa-lg fa-fw"></i>标签-->
				<i class="fa fa-chevron-right fa-lg"></i>标签
            </a>
        </li>
        
        <li>
            <a href="/archives" class="waves-effect waves-light">
                <!--<i class="fa fa-link fa-lg fa-fw"></i>归档-->
				<i class="fa fa-chevron-right fa-lg"></i>归档
            </a>
        </li>
        
        <li>
            <a href="/atom.xml" class="waves-effect waves-light">
                <!--<i class="fa fa-link fa-lg fa-fw"></i>RSS订阅-->
				<i class="fa fa-chevron-right fa-lg"></i>RSS订阅
            </a>
        </li>
        
        <li>
            <a href="/about" class="waves-effect waves-light">
                <!--<i class="fa fa-link fa-lg fa-fw"></i>关于-->
				<i class="fa fa-chevron-right fa-lg"></i>关于
            </a>
        </li>
        
    </ul>
    <div class="social-link">
        <a href="#" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub"
           data-position="top" data-delay="50">
            <i class="fa fa-github fa-lg"></i>
        </a>
        <a href="https://985540932@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我"
           data-position="top" data-delay="50">
            <i class="fa fa-envelope fa-lg"></i>
        </a>
        <a href="#!" class="tooltipped" data-tooltip="QQ号：985540932" data-position="top" data-delay="50">
            <i class="fa fa-qq fa-lg"></i>
        </a>
    </div>
</div>

            </div>
        </div>
    </nav>
</header>

<!doctype html>
<html lang=en>
<head>
    <meta charset="utf-8" />
    <title>canvas星空连线背景</title>
    <style>
    *{
        margin: 0;
        padding: 0;
    }
    #canvas{
		 position: fixed;
         background: #ccc;
		 overflow: auto;
		 z-index: -1;
    }
    </style> 
	
	<canvas id="canvas"></canvas>
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css">
<link rel="stylesheet" href="/css/prism-line-numbers.css" type="text/css"></head>
<body>
    
   
</body>
<script>
    window.requestAnimationFrame = (function(){
        return window.requestAnimationFrame ||
               window.webkitRequestAnimationFrame ||
               window.mozRequestAnimationFrame ||
               function( callback ){
                    window.setTimeout( callback, 1000/2 );
               };
    })();
    var myCanvas = document.getElementById("canvas");
    var ctx = myCanvas.getContext("2d");//getContext 设置画笔
    var num = 150;
    var w,h;
    var duixiang = [];
    var move = {};
    function widthheight(){
        w = myCanvas.width = window.innerWidth;
        h = myCanvas.height = window.innerHeight;
        for(var i = 0;i < num;i++){
            duixiang[i] = {
                x:Math.random()*w,
                y:Math.random()*h,
                cX:Math.random()*0.6-0.3,
                cY:Math.random()*0.6-0.3
            }
            console.log(duixiang[i])
            Cricle(duixiang[i].x,duixiang[i].y);
        }
    };widthheight();//获取浏览器的等宽度等高

    function Cricle(x,y){
        ctx.save();//保存路径
        ctx.fillStyle = "royalblue";//填充的背景颜色
        ctx.beginPath();//开始绘画
        ctx.arc(x,y,3,Math.PI*2,0);//绘画圆 x y 半径（大小） 角度  一个PI 是180 * 2 = 360    真假 0/1 true/false
        ctx.closePath();//结束绘画
        ctx.fill();//填充背景颜色
        ctx.restore();//回复路径
    };Cricle();


    !function draw(){
        ctx.clearRect(0,0,w,h)//先清除画布上的点
        for(var i = 0;i < num;i++){
            duixiang[i].x += duixiang[i].cX;
            duixiang[i].y += duixiang[i].cY;
            if(duixiang[i].x>w || duixiang[i].x<0){
                duixiang[i].cX = -duixiang[i].cX;
            }
            if(duixiang[i].y>h || duixiang[i].y<0){
                duixiang[i].cY = -duixiang[i].cY;
            }
            Cricle(duixiang[i].x,duixiang[i].y);
            //勾股定理判断两点是否连线
            for(var j = i + 1;j < num;j++){
                if( (duixiang[i].x-duixiang[j].x)*(duixiang[i].x-duixiang[j].x)+(duixiang[i].y-duixiang[j].y)*(duixiang[i].y-duixiang[j].y) <= 55*55 ){
                    line(duixiang[i].x,duixiang[i].y,duixiang[j].x,duixiang[j].y)
                }
                if(move.x){
                    if( (duixiang[i].x-move.x)*(duixiang[i].x-move.x)+(duixiang[i].y-move.y)*(duixiang[i].y-move.y) <= 100*100 ){
                        line(duixiang[i].x,duixiang[i].y,move.x,move.y)
                    }
                }
            }
        }
        window.requestAnimationFrame(draw)
    }();

    //绘制线条
    function line(x1,y1,x2,y2){
        var color = ctx.createLinearGradient(x1,y1,x2,y2);
        color.addColorStop(0,"#019d99");
        color.addColorStop(1,"#019ee5");
        //ctx.save();
        ctx.strokeStyle = color;
        ctx.beginPath();
        ctx.moveTo(x1,y1);
        ctx.lineTo(x2,y2);
        ctx.stroke();
        //ctx.restore();
    }


    document.onmousemove = function(e){
        move.x = e.clientX;
        move.y = e.clientY;
    }
    console.log(move)

    window.onresize = function(){
        location.reload();
    }
</script>
</html>













<div class="bg-cover post-cover" style="background-image: url('/medias/featureimages/3.jpg')">
    <div class="container">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <div class="description center-align post-title">
                        同时部署coding与github
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<main class="content">

    <!-- 文章内容详情 -->
    <div id="artDetail" class="container">
        <div class="card">
            <div class="card-content article-info">
                
                <div class="article-tag">
                    
                    <a href="https://five-great.coding.me/tags/Hexo/" target="_blank"><span class="chip bg-color">Hexo</span></a>
                    
                </div>
                
                <div class="author-info">
                    <span>
                        <i class="fa fa-calendar fa-fw"></i>2018-09-28
                    </span>
                </div>
            </div>
            <hr>
            <div class="card-content article-card-content">
                <div id="articleContent">
                    <pre><code>#前言
</code></pre><p>之前我是把hexo托管在github，但是毕竟github是国外的，访问速度上还是有点慢，所以想也部署一套在国内的托管平台，<br>所以就决定部署到coding。 查询了多方资料，终于鼓捣出了本地一次部署，同时更新到github以及coding。</p>
<p>###具体过程如下：</p>
<p> #####一·注册<br>   先注册好<a href="https://coding.net" target="_blank" rel="noopener">coding</a> 和 <a href="https://github.com" target="_blank" rel="noopener">github</a></p>
<p> #####二·创建仓库<br>    这里只介绍coding上面如何创建项目，以及把本地hexo部署到coding上面，<br>    还不懂如何创建hexo的,百度很多。首先我们创建一个项目，创建后进入项目的代码模块，获取到这个项目的ssh地址，<br>    我的是 <a href="https://git.coding.net/five-great/five-great.git" target="_blank" rel="noopener">https://git.coding.net/five-great/five-great.git</a></p>
<p> #####三·同步本地hexo到coding上<br>    把获取到了ssh配置在上面的_config.yml文件中的deploy下，如果是第一次使用coding的话，需要设置SSH公钥，<br>    生成的方法可以参考coding帮助中心<br>如果</p>
<p>本地打开 id_rsa.pub 文件，复制其中全部内容，填写到SSH_RSA公钥key下的一栏，公钥名称可以随意起名字。完成后点击“添加”，<br>然后输入密码或动态码即可添加完成。没有的话先生成，如何生成百度好了。</p>
<p>添加后，在git bash命令输入：</p>
<p>ssh -T <a href="mailto:git@git.coding.net" target="_blank" rel="noopener">git@git.coding.net</a><br>如果得到下面提示就表示公钥添加成功了：</p>
<p>Coding.net Tips : [Hello ! You’ve conected to Coding.net by SSH successfully! ]</p>
<p> #####四·配置_config.yml<br>  在Hexo根目录下_config.yml文件中的deploy如下<br>根据Hexo官方文档需要修改成下面的形式</p>
<pre class="line-numbers language-git"><code class="language-git">  deploy:
  type: git
  message: [message]
  repo:
    github: &lt;repository url>,[branch]
    coding: &lt;repository url>,[branch]
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<p>  我的为</p>
<pre><code>```git
</code></pre><p> deploy:<br> type: git<br> repo:<br>     github: <a href="mailto:git@github.com" target="_blank" rel="noopener">git@github.com</a>:Five-great/Five-great.github.io.git //SSH形式<br>     coding: <a href="https://git.coding.net/five-great/five-great.git" target="_blank" rel="noopener">https://git.coding.net/five-great/five-great.git</a>  //http形式<br> branch: master </p>
<pre><code>#####五·pages服务方式部署
   部署博客方式有两种，第一种就是pages服务的方式，也推荐这种方式，因为可以绑定域名，而第二种演示的方式必须升级会员才能绑定自定义域名。pages方式也很简单
就是在source/需要创建一个空白文件，至于原因，是因为 coding.net需要这个文件来作为以静态文件部署的标志。就是说看到这个Staticfile就知道按照静态文件来发布。
```git
cd source/
touch Staticfile  #名字必须是Staticfile
</code></pre><p>分支选择master，因为前面配置的分支是master,因此开启之后，也需要是master。然后看起之后就可访问了。</p>
<p>注意：<br>如果你的项目名称跟你coding的用户名一样，比如我的用户是叫tengj,博客项目名也叫tengj<br>那直接访问 tengj.coding.me就能访问博客，否则就要带上项目名：tengj.coding.me/项目名 才能访问<br>推荐项目名跟用户名一样，这样就可以省略项目名了</p>
<p>  最后使用部署命令就能把博客同步到coding上面：</p>
<pre class="line-numbers language-git"><code class="language-git">hexo c
hexo g
hexo d
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p>  我的博客：<br>   github: <a href="https://five-great.github.io/" target="_blank" rel="noopener">https://five-great.github.io/</a><br>   coding: <a href="https://five-great.coding.me/">https://five-great.coding.me/</a></p>

                </div>
                <hr/>

                <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    <div class="social-share" data-disabled="qzone" data-wechat-qrcode-helper="<p>微信里点“发现”->“扫一扫”二维码便可查看分享。</p>"></div>
    
</div>

<script src="/libs/share/js/social-share.min.js"></script>

                <div class="reprint">
                    <p>
                        <span class="reprint-tip">转载请注明: </span>
                        <a href="https://five-great.coding.me" class="b-link-green">Five-great的博客</a>
                        <i class="fa fa-angle-right fa-lg fa-fw text-color"></i>
                        <a href="/2018/09/28/dai-ma-ce-shi-2-fu-ben/" class="b-link-green">同时部署coding与github</a>
                    </p>
                </div>
            </div>
        </div>

        
        <link rel="stylesheet" href="/libs/gitment/gitment-default.css">
<link rel="stylesheet" href="/css/gitment.css">

<div class="gitment-card card" data-aos="fade-up">
    <div id="gitment-content" class="card-content"></div>
</div>

<script src="/libs/gitment/gitment.js"></script>
<script>
var gitment = new Gitment({
    id: 'Fri Sep 28 2018 11:43:55 GMT+0800',
    owner: '',
    repo: '',
    oauth: {
        client_id: '',
        client_secret: ''
    }
});

gitment.render('gitment-content');
</script>
        

        
        <div class="disqus-card card" data-aos="fade-up">
    <div id="disqus_thread" class="card-content">
        <noscript>Please enable JavaScript to view the
            <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
    </div>
</div>

<script type="text/javascript">
    disqus_config = function () {
        this.page.url = 'https://five-great.coding.me/2018/09/28/dai-ma-ce-shi-2-fu-ben/';
        this.page.identifier = '/2018/09/28/dai-ma-ce-shi-2-fu-ben/';
        this.page.title = '同时部署coding与github';
    };
    let disqus_shortname = 'fdfdfdfdfdf';

    (function () { // DON'T EDIT BELOW THIS LINE
        let d = document, s = d.createElement('script');
        // 如：s.src = 'https://blinkfox.disqus.com/embed.js';
        s.src = '//' + disqus_shortname + '.disqus.com/embed.js';
        s.setAttribute('data-timestamp', +new Date());
        (d.head || d.body).appendChild(s);
    })();
</script>
        

        

<article id="articles" class="container prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">上一篇</div>
            <div class="card">
                <a href="/2018/09/28/dai-ma-ce-shi-2/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/22.jpg" class="responsive-img" alt="代码测试2">
                        
                        <span class="card-title">代码测试2</span>
                    </div>
                    <div class="card-content article-content">
                        <div class="summary">
                            汉诺塔游戏                                      时间限制: 1 s｜空间限制: 32000 KB
题目描述 Description
汉诺塔问题（又称为河内塔问题），是一个大家熟知的问题。在A，B，C三根
                        </div>
                        <div class="publish-info">
                            <span class="publish-date">
                                <i class="fa fa-calendar fa-fw"></i>2018-09-28
                            </span>
                            <span class="publish-author">
                                <i class="fa fa-user fa-fw"></i>
                                
                                LHL
                                
                            </span>
                        </div>
                    </div>
                    
                    <div class="card-action article-tags">
                        
                        <a href="https://five-great.coding.me/tags/ACM/"><span class="chip bg-color">ACM</span></a>
                        
                        <a href="https://five-great.coding.me/tags/水题/"><span class="chip bg-color">水题</span></a>
                        
                    </div>
                    
                </a>
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">下一篇</div>
            <div class="card">
                <a href="/2018/09/28/ce-shi/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/2.jpg" class="responsive-img" alt="测试">
                        
                        <span class="card-title">测试</span>
                    </div>
                    <div class="card-content article-content">
                        <div class="summary">
                            #测试这是我的测试文章:)这是我的测试文章:)这是我的测试文章:)
写作介绍1，字体介绍这是斜体 或 这也是斜体这是粗体这是加粗斜体这是删除线
2，分级标题一级标题二级标题三级标题四级标题五级标题六级标题3，超链接写法：
行内形式：我的博客
                        </div>
                        <div class="publish-info">
                            <span class="publish-date">
                                <i class="fa fa-calendar fa-fw"></i>2018-09-28
                            </span>
                            <span class="publish-author">
                                <i class="fa fa-user fa-fw"></i>
                                
                                LHL
                                
                            </span>
                        </div>
                    </div>
                    
                    <div class="card-action article-tags">
                        
                        <a href="https://five-great.coding.me/tags/ACM/"><span class="chip bg-color">ACM</span></a>
                        
                        <a href="https://five-great.coding.me/tags/水题/"><span class="chip bg-color">水题</span></a>
                        
                        <a href="https://five-great.coding.me/tags/测试/"><span class="chip bg-color">测试</span></a>
                        
                    </div>
                    
                </a>
            </div>
        </div>
        
    </div>
</article>
    </div>
</main>


<!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fa fa-angle-double-up"></i>
    </a>
</div>



   <footer class="page-footer bg-color">

	<div>
	    <li class="col s12 m8 l8 copy-right">
	 友链：
	      <a href="https://blog.csdn.net/qq_41923622" target="_blank"><i class="fa fa-link fa-lg"></i> Five-菜鸟级  </a> 
          &nbsp;&nbsp;<a href="http://blinkfox.com/" target="_blank"><i class="fa fa-link fa-lg"></i> 闪烁之狐  </a>  	
          &nbsp;&nbsp;<a href="https://blinkfox.github.io/" target="_blank"><i class="fa fa-link fa-lg"></i> 闪烁之狐(github)</a>  				  
		</li>
		
	</div>
	<div class="container row center-align">
        <div class="col s12 m8 10 copy-right">
           本站由&copy;<a href="http://#" target="_blank">LHL</a>基于
            <a href="https://hexo.io/" target="_blank">Hexo</a>与
            <a href="https://github.com/" target="_blank">github</a>搭建.
        </div>
        <div class="col s12 m4 5 social-link">
            <a href="https://github.com/Five-great/Five-great.github.io" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
                <i class="fa fa-github fa-lg"></i>
            </a>
            <a href="https://985540932@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
                <i class="fa fa-envelope fa-lg"></i>
            </a>
            <a href="#!" class="tooltipped" data-tooltip="QQ: 985540932" data-position="top" data-delay="50">
                <i class="fa fa-qq fa-lg"></i>
            </a>
			<a href="#!" class="tooltipped" data-tooltip="微信:qq985540932" data-position="top" data-delay="50">
                <i class="fa  fa-wechat fa-lg"></i>
            </a>
        </div>
    </div>
</footer>
<div class="progress-bar"></div>

<!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <!--<span class="title">搜索</span>-->
			
			<!--改LHLs-->
			 <span class="title">搜索</span>
			   <!--改LHLt-->
			   
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input" autofocus="">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
</script>

<script src="/libs/materialize/js/materialize.min.js"></script>
<script src="/libs/masonry/masonry.pkgd.min.js"></script>
<script src="/libs/aos/aos.js"></script>
<script src="/libs/scrollprogress/scrollProgress.min.js"></script>
<script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
<script src="/js/matery.js"></script>
</body>

</html>